/**
 * File    : UniversalDao.java
 * Created : 2007-12-20
 * By      : lhg
 */
package com.luhuiguo.sso.dao;

import java.io.Serializable;
import java.util.List;

/**
 * @author lhg
 * @version $Id: UniversalDao.java 16 2008-10-17 13:13:27Z LuHuiguo $
 * 
 */
public interface UniversalDao {

	<T> T get(Class<T> entityClass, Serializable id);

	void create(Object entity);

	<T> T update(T entity);

	void delete(Object entity);

	void delete(Class<?> entityClass, Serializable id);

	<T> List<T> findByProperty(Class<T> entityClass, String propertyName,
			final Object value, final int... rowStartIdxAndCount);

	<T> List<T> findAll(Class<T> entityClass, final int... rowStartIdxAndCount);

	Object findFirstByNamedQuery(final String queryName, final Object... values);

}
